interface IPerson {
  name:string
  age:number
}


let  tom: IPerson = {
  name:'tom',
  age:23
}


function createArray<U>(length: number, value: U): Array<U> {
  let result: U[] = [];
  for (let i = 0; i < length; i++) {
      result[i] = value;
  }
  return result;
}

createArray(3, 3); // ['x', 'x', 'x']


function swap<T, U>(tuple: [T, U]): [U, T] {
  return [tuple[1], tuple[0]];
}

swap([7, 'seven']); // ['seven', 7]